CC = gcc
CFLAGS = -Wall -g
OBJ = $(patsubst %.c, %.o, $(wildcard *.c))
TARGET = main

all: $(TARGET)

%.o: %.c
	$(CC) $(CFLAGS) -c $< -o $@

$(TARGET): $(OBJ)
	$(CC) $(OBJ) -o $(TARGET)

clean:
	rm -f $(OBJ) $(TARGET)